package com.bangcommunity.bbframe.mlog.logger;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author tanghc
 * @date 18/1/29
 */
public abstract class LogFacilityFacade {
    static Logger logger = LoggerFactory.getLogger(LogFacilityFacade.class);

    public static Logger createLogger(MLoggerName mLoggerName, String mkey) {
        String lname = logger.getClass().getName().toLowerCase();
        if (lname.contains("logback")) {
            logger.debug("create logback");
            return LogbackFacility.createLogger(mLoggerName, mkey);
        } else if (lname.contains("log4j")) {
            logger.debug("create log4j");
            return Log4jFacility.createLogger(mLoggerName, mkey);
        }
        return logger;
    }
}
